fix(#711): enforce sender ownership on cancel endpoint and fix pre-existing blockers - #909
Conversation
…fix pre-existing blockers The cancel endpoint already had authMiddleware and a sender ownership check on main, but three pre-existing issues prevented the endpoint from working: - Fix malformed TransactionBuilder in streamStore.ts (merge conflict artifact) - Add missing syncFtsIndex export to db.ts (imported but never defined) - Add missing cliff_seconds column via addColumnIfMissing in initDb() - Initialize cache in auth.test.ts and cancel integration test All 28 related tests now pass (auth, cancel, migrations). 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@Danielkallala is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Danielkallala Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Overview
This PR fixes issue #711 by ensuring the
POST /api/streams/:id/cancelendpoint properly validates sender ownership. The endpoint already hadauthMiddlewareand a sender ownership check onmain, but three pre-existing bugs prevented it from actually working, causing 500 errors.Related Issue
Closes #711
Changes
🔧 Fix malformed TransactionBuilder in streamStore.ts
new TransactionBuilder(...)call caused a syntax error preventing compilation📦 Add missing
syncFtsIndexexport to db.tsstreamStore.tsimportedsyncFtsIndexfromdb.tsbut it was never defined🗄️ Add missing
cliff_secondscolumn viaaddColumnIfMissingininitDb()upsertStream()referencescliff_secondscolumn but no migration existed for itaddColumnIfMissingpattern for backwards-compatible schema patching🧪 Initialize cache in test setup files
auth.test.tsandstreamStore.cancel.integration.test.tsnow callinitCache()before testscancelStream()callsinvalidateCache()which throws if cache is not initializedVerification Results
✅ 17/17 auth tests passed
✅ 7/7 cancel integration tests passed
✅ 4/4 migration tests passed
Acceptance Criteria
Files Changed
backend/src/services/streamStore.tsbackend/src/services/db.tssyncFtsIndex,addColumnIfMissing, andcliff_secondscolumn patchbackend/src/auth.test.tsinitCache()call in test setupbackend/src/services/streamStore.cancel.integration.test.tsinitCache()call in test setup🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com